class Solution:
    def hammingWeight(self, n: int) -> int:
        ret = 0
        while n:
            ret += (n & 1)
            n = n >> 1
        return ret

if __name__ == '__main__':
    so = Solution()
    s = 3
    r = so.hammingWeight(s)
    print(r)
